using System.Collections;
using TMPro;
using UnityEngine;

public class TextBubble : MonoBehaviour
{
	public static TextBubble instance;

	public GameObject GO_TextBox;

	public TextMeshProUGUI txt;

	private void Awake()
	{
		instance = this;
	}

	public void Show(Vector2 pos, string str, float time)
	{
		base.transform.position = pos;
		GO_TextBox.SetActive(true);
		txt.text = str;
		StartCoroutine(IE_Show(time));
	}

	private IEnumerator IE_Show(float time)
	{
		yield return new WaitForSeconds(time);
		GO_TextBox.SetActive(false);
	}
}
